import request from '@/utils/request.js'

// cc1.0 list 接口
export const cc1List = (data) => {
    return request({
        url: '/cc1/record',
        method: 'post',
        data: data
    })
}
// tncs list 接口
export const tncsList = (data) => {
    return request({
        url: '/tncs/record',
        method: 'post',
        data: data
    })
}

// cc2.0 list 接口
export const cc2List = (data) => {
    return request({
        url: '/cc2/record',
        method: 'post',
        data: data
    })
}

// 获取质检模版
export const getTemplate = (type, id) => {
    return request({
        url: `/template/conform/${type}/${id}`,
        method: 'get'
    })
}

// 新增质检任务
export const newTask = (data) => {
    return request({
        url: '/task',
        method: 'post',
        data
    })
}

// 新增预设规则
export const newPreset = (data) => {
    return request({
        url: '/preset',
        method: 'post',
        data
    })
}

// 预设规则option 数据
export const requestRuleList = (id) => {
    return request({
        url: `/preset/list/${id}`,
        method: 'get'
    })
}



// 预设管理分页列表
export const presetList = (params) => {
    return request({
        url: `/preset/list`,
        method: 'get',
        params
    })
}
// 获取预设规则详情
export const detailPreset = (id) => {
    return request({
        url: `/preset/${id}`,
        method: 'get'
    })
}
// 删除预设管理
export const delPreset = (id) => {
    return request({
        url: `preset`,
        method: 'delete',
        params: {
            id
        }
    })
}
